# GPL3 or later

# This is a setup script.

import os
import json
from modules.ui import *
from getpass import getpass

def run():
    try:
        with open('stuff.json') as json_file: 
            stuff = json.load(json_file)

    except:
        stuff = {}


    center("Setting Up The Program")
    if "matrix" not in stuff:
        stuff["matrix"] = {}
    stuff["matrix"]["username"] = input("Matrix Bot's Username : ")
    stuff["matrix"]["password"] = getpass("Matrix Bot's Password : ")
    stuff["matrix"]["room"] = input("Matrix Music Room Name : ")

    with open('stuff.json', 'w') as fp:
        json.dump(stuff, fp, indent=4)
    
    center("Setup Is Finished!")
